package com.ithe.shopweb.serve.impl;

import com.ithe.shopweb.mapper.PersonMapper;
import com.ithe.shopweb.pojo.resp.OfferResp;
import com.ithe.shopweb.serve.PersonServe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 功能：
 * 日期： 2024/5/22 17:04
 */
@Service
public class PersonServeImpl implements PersonServe {

    @Autowired
    private PersonMapper personMapper;

    @Override
    public List<OfferResp> personTable(String cartUser, String offerID, Integer pageNum, Integer pageSize) {
        return personMapper.personTable(cartUser, offerID, pageNum, pageSize);
    }

    @Override
    public List<OfferResp> cartTable(String offerUser, String offerID, Integer pageNum, Integer pageSize) {
        return personMapper.cartTable(offerUser, offerID, pageNum, pageSize);
    }

    @Override
    public List<OfferResp> recordTable(String cartUser, String offerID, Integer pageNum, Integer pageSize) {
        return personMapper.recordTable(cartUser, offerID, pageNum, pageSize);
    }

    @Override
    public List<OfferResp> recordAll(String cartUser, String offerID) {
        return personMapper.recordAll(cartUser, offerID);
    }

    @Override
    public String nameTransform(String cartUser) {
        return personMapper.nameTransform(cartUser);
    }

    @Override
    public List<OfferResp> offerAll(String offerUser, String offerID) {
        return personMapper.offerAll(offerUser, offerID);
    }

    @Override
    public List<OfferResp> cartAll(String cartUser, String offerID) {
        return personMapper.cartAll(cartUser, offerID);
    }



    @Override
    public Integer offerDelete(String offerID) {
        return personMapper.offerDelete(offerID);
    }

    @Override
    public Integer cartDelete(String offerID) {
        return personMapper.cartDelete(offerID);
    }

    @Override
    public Integer cartBuy(String offerID, String offerImage, String offerName,
                           String offerStyle, String offerState, String offerLocal,
                           String offerDegree, Double finalPrice, String userLocal, String offerUser, String cartUser) {
        return personMapper.cartBuy(offerID, offerImage, offerName, offerStyle, offerState, offerLocal, offerDegree, finalPrice, userLocal, offerUser, cartUser);
    }

    @Override
    public Integer offerAdd(String offerID, String offerImage, String offerName,
                            String offerStyle, Double offerPrice, String offerLocal,
                            String offerDiscount, String offerDegree, Double finalPrice, String offerUser) {
        return personMapper.offerAdd(offerID, offerImage, offerName, offerStyle, offerPrice, offerLocal, offerDiscount, offerDegree, finalPrice, offerUser);
    }
}
